package com.sdi.columbus;

import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;

public class GetAsset {
	private static final String SOAP_ACTION = "http://www.tel-india.com/GetAssetDetail";
    private static final String METHOD_NAME = "GetAssetDetail";
    private static final String NAMESPACE = "http://www.tel-india.com/";
    private static final String URL = "http://118.67.250.200/columbuswebservice/clientservice.asmx";
    
    public SoapObject GetValues(int VehicleId)
    {
    	
    	SoapObject request = new SoapObject(NAMESPACE,METHOD_NAME);
    	PropertyInfo pi=new PropertyInfo();
    	
    			pi.setName("VehicleId");
    	        pi.setValue(VehicleId);
    	        pi.setType(String.class);
    	        request.addProperty(pi);
    	        pi=new PropertyInfo();

    	SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
    	SoapEnvelope.VER11);
    	envelope.dotNet = true;

    	envelope.setOutputSoapObject(request);

    	HttpTransportSE httpTransport = new HttpTransportSE(URL);
    	Object response=null;
    	System.out.println("Getting Values");
    	try
    	{
    		httpTransport.call(SOAP_ACTION, envelope);
    		response = envelope.getResponse();
    		
    		
    		System.out.println("From GetAssetDetail :"+response);
    		return (SoapObject) response;
       	}
    	catch (Exception exception)
    	{
    		response=exception.toString();
    		return null;
    	}
    	
    }

	

}
